# 函数——一段可以被重复使用的代码


# 求 1- 100 的和

theSum = 0
for i in range(1, 101):
    theSum += i
print(theSum)

# 求300-400的和
theSum = 0
for i in range(300, 401):
    theSum += i
print(theSum)

# 求1-1000的和
theSum = 0
for i in range(1, 1001):
    theSum += i
print(theSum)








